#ifndef SYNCDLG_H
#define SYNCDLG_H

//
// Implements modal dialog but allows thread waits (i.e. implements its on
// msg loop with MsgWaitForMultipleObjectsEx
//
class SyncDialog
{
	public:
		SyncDialog(HWND hParent, HINSTANCE hInst);
		virtual ~SyncDialog();

		int getResult();

		HWND getHWnd();
		HWND getParentHWnd();

		virtual int Run();

	protected:
		static BOOL FAR PASCAL topDialogProc(HWND, UINT, WPARAM, LPARAM);
		virtual BOOL dialogProc(HWND, UINT, WPARAM, LPARAM);

		void EndDialog(HWND, int);

	protected:
		HWND hParent, hDialog;
		HINSTANCE hInst;
		int	 result;
};

inline int
SyncDialog::getResult()
{
	return result;
}

inline HWND
SyncDialog::getHWnd()
{
	return hDialog;
}

inline HWND
SyncDialog::getParentHWnd()
{
	return hParent;
}

#endif
